feat(web-api): expose public ts property on ChatStream#2611
Conversation
🦋 Changeset detectedLatest commit: d12828f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2611 +/- ##
==========================================
+ Coverage 88.86% 88.88% +0.01%
==========================================
Files 62 62
Lines 10230 10239 +9
Branches 450 451 +1
==========================================
+ Hits 9091 9101 +10
+ Misses 1117 1116 -1
Partials 22 22
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
WilliamBergamin
left a comment
There was a problem hiding this comment.
Nice work 💯 changes seem good to me! I left one addressable non blocking comment
| * stream expires server-side. | ||
| * @see {@link https://docs.slack.dev/reference/methods/chat.update} | ||
| */ | ||
| get ts(): string | undefined { |
There was a problem hiding this comment.
I think this is one of the rare times we use the get operator in this project 🤔 I think it makes sense to use it here, it should give us the flexibly to add a setter if we ever need to and exposes the property as readonly
There was a problem hiding this comment.
yes i agree - best to keep it readonly!
Co-authored-by: William Bergamin <wbergamin@salesforce.com>
Summary
This PR adds a public read-only ts getter to ChatStreamer, enabling users to call chat.update as a fallback when the server closes a stream due to undocumented timeouts.
Background
When Slack's server-side timeout kills a stream, both
chat.appendStreamandchat.stopStreamreturnmessage_not_in_streaming_state. The message still exists but is stuck as a broken pill in the UI. The only recovery path ischat.update({ ts: ... }), buttswas previously a private field (streamTs).Changes
packages/web-api/src/chat-stream.ts: Addedtsgetter (read-only, returnsstring | undefined)packages/web-api/src/WebClient.test.ts: Added test verifyingtsis undefined before flush and set aftercode snippet
Requirements